<?php

defined("IN_TS") or die("Access Denied.");

class Tbshare extends tsApp {
	
	var $lang = array("url_invalid"=>"网址不合法",
					 "error_to_redo"=>"出错了,请重试",
					 "item_not_exist"=>"商品不存在",
					 "favor_exist" => "您已经喜欢过该商品"
	);

	public function __construct($db) {
		parent::__construct($db);
	}

	public function __($key,$default = '') {
		return isset($this->lang[$key])?$this->lang[$key]:$default;
	}

	function getTbItem($itemid) {
		require_once dirname(__FILE__) . "/taoapi/Taoapi.php";
		$taoapi = new Taoapi();
		$para = array(
			'fields'=>'num_iid,title,nick,location,price,pic_url',
			"num_iid"=>$itemid,
			'method'=>'taobao.item.get',
		);
		$taoapi->setUserParam($para);
		$taoapi->send("GET","json");
		$data = $taoapi->getJsonData();
		return json_decode($data);
	}


}





